window.onload = function () {
var serviceMenu = document.getElementById("lm1");
var service = document.getElementById("m1");
setEvent(lm1, m1);
var downloadMenu = document.getElementById("lm2");
var download = document.getElementById("m2");
setEvent(lm2, m2);
var docsMenu = document.getElementById("lm3");
var docs = document.getElementById("m3");
setEvent(lm3, m3);
var docsMenu = document.getElementById("lm4");
var docs = document.getElementById("m4");
setEvent(lm4, m4);
var docsMenu = document.getElementById("lm5");
var docs = document.getElementById("m5");
setEvent(lm5, m5);
var docsMenu = document.getElementById("lm6");
var docs = document.getElementById("m6");
setEvent(lm6, m6);
var docsMenu = document.getElementById("lm7");
var docs = document.getElementById("m7");
setEvent(lm7, m7);
var docsMenu = document.getElementById("lm8");
var docs = document.getElementById("m8");
setEvent(lm8, m8);
var docsMenu = document.getElementById("lm9");
var docs = document.getElementById("m9");
setEvent(lm9, m9);
}
function setEvent ( menu, item ) {
menu.onmouseover = function() { showMenu(item) };
menu.onmouseout = function() { hideMenu(item) };
item.onmouseover = function() { showMenu(item) };
item.onmouseout = function() { hideMenu(item) };
}
var menuIsVisible = false;
var visibleItem = null;
function showMenu( item ) {
if( visibleItem == item ) {
return;
} else if( visibleItem != null ){
hideMenu( visibleItem );
}
visibleItem = item;
menuIsVisible = true ;


var menu = document.getElementById('l' + item.id );
menu.style.backgroundColor="#663399";
if( document.all ){
item.style.left = menu.offsetLeft + document.body.offsetLeft + "px";
item.style.top = menu.offsetTop
+ document.body.offsetTop + menu.offsetHeight + "px";
} else{
item.style.left = menu.offsetLeft + "px";
item.style.top = menu.offsetTop + menu.offsetHeight + "px";
}
item.style.visibility = 'visible';
}
function hideMenu( item ) {
if(!menuIsVisible) {
return ;
}
visibleItem = null;
menuIsVisible = false ;
var menu = document.getElementById( 'l' + item.id );
menu.style.backgroundColor = "#9966FF";
item.style.visibility = "hidden";
}
var cont = 'm0' ;
function disp(contdiv) {
if(cont != contdiv) {
document.getElementById(cont).style.display = 'none' ;
document.getElementById(contdiv).style.display = 'block' ;
cont = contdiv ;
} else {
return ;
}
}
